package cn.xinfei.xdecision.common.utils.enums.enginex.action;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * 动作服务枚举
 */
@Getter
@AllArgsConstructor
public enum ActionServerEnum{

    OLD_ACTION_SERVER(1, "老模型服务"),

    NEW_ACTION_SERVER(2, "新模型服务");

    private final Integer code;

    private final String desc;

    public static String convertEnum() {
        JSONArray jsonArray = new JSONArray();
        for (ActionServerEnum value : ActionServerEnum.values()) {
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("code", value.getCode());
            jsonObject.put("desc", value.getDesc());
            jsonArray.add(jsonObject);
        }
        return jsonArray.toJSONString();
    }
}
